using System;
using System.ComponentModel.DataAnnotations;

//https://learn.microsoft.com/en-us/aspnet/core/mvc/models/validation?view=aspnetcore-8.0
namespace StateManagement.Models {
  public class Book : Product {
    public int Id { get; set; }

    [Required]
    [StringLength(13)]
    public string ISBN { get; set; }

    [Required]
    public string Title { get; set; }

    public string Author { get; set; }

    [Display(Name = "Year of Publish")]
    [Range(1900, 2500)]
    public int Year { get; set; }

    public override string Code => ISBN;

  }
}
